<?php
 @mysql_connect('localhost', 'root', 'root');
if (mysql_errno()) {
    die(mysql_errno());
}
mysql_select_db('blog');
mysql_set_charset('utf8');

$sql = "select * from title ";

$res = mysql_query($sql);
while ($row = mysql_fetch_assoc($res)) {
    $arr[] = $row;
}

mysql_close();

include_once '../public/qian.php';
?>

    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/admin/index.php">作品管理</a><span class="crumb-step">&gt;</span><span class="crumb-name">新增作品</span></div>
        </div>
 <div class="result-wrap">
            <div class="result-content">
                <form action="doadd.php" method="post" enctype="multipart/form-data">
                    <table class="insert-tab" width="100%">
                        <tbody>
                            <tr>
                                <th>所属分类：<select name="fenlei" >
                                 
                                    <?php 
                                         foreach ($arr as  $v) {
                                    echo    ' <option value='.$v['name'].'>'.$v['name'].'</option>';

                                         }
                                    ?>
                                </select>  </th>
                               
                            </tr>

                            <tr>
                                <th>文章配图：</th>
                                <td>
                                   <input type="file" name="pic"> <br> 
                                </td>
                            </tr>
                             <tr>
                                <th>文章标题：</th>
                                <td>
                                   <input class="common-text required" id="title" name="title" size="50" value="" type="text"> 
                                </td>
                            </tr>
                             <tr>
                                <th>文章内容：</th>
                                <td>
                            <script id="container" name="content" type="text/plain" style="width: 1000px">
                             </script>
                                </td>
                            </tr>
                            <tr>
                                <th>状态：</th>
                                <td>
                                   <input class="common-text required" id="title" name="zhuangtai" size="50" value="T" type="radio" checked> 正常
                                   <input class="common-text required" id="title" name="zhuangtai" size="50" value="F" type="radio">不正常
                                </td>
                            </tr>
                            <tr>
                                <th></th>
                                <td>
                                    <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody></table>
                         <!-- 配置文件 -->
    <script type="text/javascript" src="/public/baidu/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="/public/baidu/ueditor.all.js"></script>
    <!-- 实例化编辑器 -->
    <script type="text/javascript">
        var ue = UE.getEditor('container');
    </script>
                </form>
            </div>
        </div>

    </div>
    <!--/main-->
<?php
include_once '../public/hou.php';
?>